
import javax.microedition.lcdui.Canvas;
import javax.microedition.lcdui.Graphics;

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
/**
 *
 * @author tandn
 */
public class CCanvas extends Canvas implements Runnable
{
    private CSprite m_spriteFarmLand;

    public CCanvas()
    {
        //full mode
        setFullScreenMode(true);
        //load data
        m_spriteFarmLand = new CSprite();
        m_spriteFarmLand.loadData("res.easyrgb");
        //start the thread
        new Thread(this).start();
    }

    protected void paint(Graphics g)
    {
        g.setColor(0xFFFFFF);
        g.fillRect(0, 0, getWidth(), getHeight());
        m_spriteFarmLand.paintModule(g, RESOURCE.FARM_LANDS.A, 0, 0);
        m_spriteFarmLand.paintModule(g, RESOURCE.FARM_LANDS.B, 30, 30);
        m_spriteFarmLand.paintModule(g, RESOURCE.FARM_LANDS.C, 60, 60);
    }

    public void run()
    {
        while (true)
        {
            update();
            repaint();
        }
    }

    private void update()
    {
    }
}

